package com.thf.controller.user;

import com.alibaba.fastjson.JSON;
import com.thf.model.ResultData;
import com.thf.service.UserService;
import com.thf.util.Tool;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.ServletException;
import java.io.IOException;


@Controller
public class UserGoEditController {
    @Resource
    private UserService userService ;
    @RequestMapping("/user/goEdit")
    @ResponseBody
    protected String userGoEdit(String id) throws ServletException, IOException {

        ResultData result = userService.getUserById(Tool.stringToInt(id));
        //       反馈给前端--返回值
        String resJson = JSON.toJSONString(result);
        return resJson ;
    }
}
